package com.xinlianshiye.im.service

import com.xinlianshiye.im.ContentBody
import com.xinlianshiye.im.bean.Friend
import com.xinlianshiye.im.bean.Record
import com.xinlianshiye.im.response.Page
import com.xinlianshiye.im.response.RecordPageView
import java.time.LocalDate

interface RecordService {
    fun getOrElseThrow(id: Int?): Record
    fun send(userId: Int?, otherId: Int?, contentBody: ContentBody?): Record
    fun read(sender: Int?, receiver: Int?)

    /**
     * 查询与指定用户的未读消息(查询后变为已读)
     */
    fun listUnRead(ownerId: Int?, otherId: Int?): List<Record?>
    fun page4APP(userId: Int?, other: Int?, start: Int?, limit: Int?): Page<Record?>

    /**
     * @Author zw
     * @Description 好友聊天记录
     * @Date 14:10 2019/8/29
     * @Param
     */
    fun page4PC(ownerId: Int?, otherId: Int?, start: Int?, limit: Int?, keyword: String?, startDate: LocalDate?): RecordPageView
    fun deleteByFriend(friend: Friend?)

    /**
     * 逻辑删除聊天记录(单方)
     */
    fun delete(ownerId: Int?, otherId: Int?)
}